﻿@model PagedList.IPagedList<MsForgeReboot.Framework.Entities.Event>

@{
    ViewBag.Title = "Index";
}

<h2>Nаredni događaji</h2>

<p>
    @Html.ActionLink("Napravite novi dogadjaj", "Create", null, new { @class = "btn btn-primary" })
</p>
@Html.Partial("_PagedView", Model)
<ul>
    @foreach (var item in Model) {
        <li>
            <div>
                <h3>@Html.ActionLink(item.Title, "Edit", new { urlPointer = item.UrlPointer })</h3>
                <div>
                    @Html.DisplayFor(modelItem => item.Topic)
                </div>
                <div>
                    @Html.DisplayFor(modelItem => item.Begin) - @Html.DisplayFor(modelItem => item.End)
                </div>
                <div>
                    @Html.DisplayFor(modelItem => item.Venue)
                </div>
                @if (item.IsStreamingEvent) {
                    <div>
                        @Html.DisplayFor(modelItem => item.StreamingInstructions)
                    </div>
                }
                <div>
                    @Html.DisplayFor(modelItem => item.Body)
                </div>
                <div>
                    @Html.ActionLink("Edit", "Edit", new { id=item.Id }, new { @class = "btn btn-small" }) |
                    @Html.ActionLink("Delete", "Delete", new { id=item.Id }, new { @class = "btn btn-danger btn-small" })
                </div>
            </div>
        </li>
    }
</ul>
@Html.Partial("_PagedView", Model)
<script>
    @section Scripts {
    @Scripts.Render("~/bundles/controlpanel/event/index")
}</script>
